package com.example.equipmentmanage.utils

import android.content.Context
import com.example.equipmentmanage.entity.SheBeiEntity
import com.example.equipmentmanage.entity.SheDetailEntity
import com.example.lib_base.http.Cont
import com.example.lib_base.mvvm.Res
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query

interface ApiService {
    @GET(Cont.SHEBEI_URL)
    suspend fun getSheBei():Res<SheBeiEntity>
    @GET(Cont.SHEBEIDETAIL_URL)
    suspend fun getSheDetail(@Path("id") id:Int):Res<SheDetailEntity>
    @POST(Cont.SHEBEIADD_URL)
    suspend fun addSheBei(@Body body: RequestBody):Res<SheDetailEntity>
    @DELETE(Cont.DELETESHEBEI_URL)
    suspend fun deleteSheBei(@Path("id") id:Int):Res<Boolean>
    @PUT(Cont.UPDATASHEBEI_URL)
    suspend fun updateSheBei(@Path("id") id:Int,@Body body: RequestBody):Res<SheDetailEntity>
    @GET(Cont.QUERYSHEBAI_URL)
    suspend fun querySheBei(@Query("keyword") keyword:String):Res<SheBeiEntity>

}